//
//  OfficeNoticeTableViewCell.swift
//  EduManage
//
//  Created by design02 on 16/12/19.
//  Copyright © 2016年 wsl. All rights reserved.
//

import UIKit

class OfficeNoticeTableViewCell: UITableViewCell {

    
    var userTx: UIImageView!
    var userName: UILabel!
    var readLabel: UILabel!
    var unReadLabel: UILabel!
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        setupViews()
    }
    
    func setupViews() {
        
        userTx = UIImageView.init(frame: CGRect(x: 20, y: 10, width: 40, height: 40))
        userTx.layer.cornerRadius = 20
        userTx.layer.masksToBounds = true
        
        userName = UILabel.init(frame: CGRect(x: userTx.frame.maxX + 10, y: 10, width: 100, height: 40))
        userName.textColor = textlight
        userName.font = UIFont.systemFont(ofSize: 16)
        
        let readLabelW: CGFloat = 70
        let readLabelH: CGFloat = 40.0
        let readLabelX: CGFloat = screenW - readLabelW * 2 - 20
        let readLabelY: CGFloat = 10.0
        
        
        readLabel = UILabel.init(frame: CGRect(x: readLabelX, y: readLabelY, width: readLabelW, height: readLabelH))
        readLabel.textColor = textlight
        readLabel.font = UIFont.systemFont(ofSize: 16)
        readLabel.textAlignment = NSTextAlignment.left
        
        unReadLabel = UILabel.init(frame: CGRect(x: readLabel.frame.maxX, y: readLabelY, width: readLabelW, height: readLabelH))
        unReadLabel.textColor = textlight
        unReadLabel.font = UIFont.systemFont(ofSize: 16)
        unReadLabel.textAlignment = NSTextAlignment.left
        
        self.contentView.addSubview(userTx)
        self.contentView.addSubview(userName)
        self.contentView.addSubview(readLabel)
        self.contentView.addSubview(unReadLabel)
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
